<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var arr = ['a', 'b', 'c', 'd'];
    arr[2] = 123;
    arr[3] = 456;
    console.log(arr); // 输出结果：(4) ["a", "b", 123, 456]
  </script>  
</body>
</html>